﻿@{
    ViewBag.Title = "新账号配置页面";
    Layout = "~/Views/Shared/IniterBaseView.cshtml";
}
<script type="text/javascript">
    function Delete(id) {
        if (confirm("确定要删除小组吗？")) {
            var inProcess = false;
            var set = document.getElementById("iid").value;
            if (set == 1) {
                inProcess = true;
            }
            if (inProcess) {
                location.href = "/Group/Delete/" + id + "?type=1";
            } else {
                location.href = "/Group/Delete/" + id;
            }
        }
    }

    function Edit(id) {
        var inProcess = false;
        var set = document.getElementById("iid").value;
        if (set == 1) {
            inProcess = true;
        }
        if (inProcess) {
            location.href = "/Group/Edit/" + id + "?type=1";
        } else {
            location.href = "/Group/Edit/" + id;
        }

    }
</script>
<div style="height: 40px; width: 100%; line-height: 40px;">
    <p>
        &nbsp;
    </p>
</div>
<div style="font-size: 22pt; text-align: center;">
    小组信息<span style="font-size: 9pt;"> 确认</span></div>
<form method="post" action="" id="form1">
<input type="hidden" id="iid" name="iid" value="@ViewBag.iid" />
<div style="height: 20px; width: 80%; line-height: 20px; text-align: right; float: none;">
</div>
<div style="width: 100%; text-align: center; padding-left: 10%;">
    <table style="width: 80%;" class="list">
        <tr>
            <td class="title">
                小组名称
            </td>
            <td class="title">
                组长
            </td>
            <td class="title">
                编辑
            </td>
            <td class="title">
                删除
            </td>
        </tr>
        @foreach (BenefitHelper.Sys.Groups t in ViewBag.groups)
        {
            <tr>
                <td>
                    @t.GroupName
                </td>
                <td>
                    @{
               List<BenefitHelper.Sys.GroupMaster> aa = ViewBag.masters;
               var query = aa.Where(a => a.GroupId == t.Id);
               foreach (BenefitHelper.Sys.GroupMaster gm in query)
               {
                        @gm.Master.UName <span>&nbsp;&nbsp;</span>
               }
                    }
                </td>
                <td style="width: 80px;">
                    <span onclick="Edit(@t.Id)" style="">编辑</span>
                </td>
                <td style="width: 80px;">
                    <span onclick="Delete(@t.Id)" style="">删除</span>
                </td>
            </tr> 
        }
    </table>
</div>
</form>
<div style="height: 20px; width: 80%; line-height: 20px; text-align: right; float: none;">
    <div style="padding-top: 30px;">
        @{
            if (!string.IsNullOrEmpty(Request.QueryString["type"]))
            {
            @Html.ActionLink("添加 一个新的小组", "Create", "Group", new { type = "1" }, null)
            }
            else
            {
            @Html.ActionLink("添加 一个新的小组", "Create", "Group", null, null)
            }
        }
    </div>
</div>
<div style="height: 20px; width: 100%; line-height: 20px;">
    <p>
        &nbsp;
    </p>
</div>
@if (string.IsNullOrEmpty(ViewBag.iid))
{
    <div style="font-size: 16pt; text-align: center;" class="list">
        点击 <span>@Html.ActionLink("下一步", "AddNewOperator", "Init", null, null)</span> 继续</div>
}
else
{
    <div style="font-size: 16pt; text-align: center;" class="list">
        <span onclick="javascript:location.href='/Init/More'">返回</span></div>
}
<div style="height: 40px; width: 100%; line-height: 40px;">
    <p>
        &nbsp;
    </p>
</div>
